﻿// Pipeline Component Library Example
// ----------------------------------
// Colin Bowern (colinbowern@hotmail.com)
// January 2007
//
// Copyright (c) 2007 Colin Bowern
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// * The above copyright notice and this permission notice shall be included in
//   all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

#region References
using Microsoft.CommerceServer.Runtime;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using RockstarGuys.PipelineComponents;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
#endregion

namespace RockstarGuys.PipelineComponents.Tests
{
    /// <summary>
    ///This is a test class for RockstarGuys.PipelineComponents.SimpleListContainer&lt;T, StorageContainerType&gt; and is intended
    ///to contain all RockstarGuys.PipelineComponents.SimpleListContainer&lt;T, StorageContainerType&gt; Unit Tests
    ///</summary>
    [TestClass]
    public class SimpleListContainerTest
    {
        #region Constructor
        /// <summary>
        /// Positive: Default constructor
        /// </summary>
        [TestMethod]
        public void ConstructorTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> actual = new SimpleListContainer<PromoCodeRecord, IDictionary>();
            Assert.IsNotNull(actual);
            Assert.AreEqual<int>(0, actual.Count);
        }

        /// <summary>
        /// Positive: Container constructor
        /// </summary>
        [TestMethod]
        public void ConstructorTest2()
        {
            ISimpleList container = new SimpleListClass();
            PromoCodeRecord promoCodeRecord = new PromoCodeRecord();
            object transport = (object)promoCodeRecord.InnerDictionary;
            container.Add(ref transport);

            SimpleListContainer<PromoCodeRecord, IDictionary> actual = new SimpleListContainer<PromoCodeRecord, IDictionary>(container);
            Assert.IsNotNull(actual);
            Assert.AreEqual<int>(1, actual.Count);
        }


        /// <summary>
        /// Fault: Incorrect type in container
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentTypeException))]
        public void ConstructorFaultTest1()
        {
            ISimpleList container = new SimpleListClass();
            int intValue = int.MaxValue;
            object transport = (object)intValue;
            container.Add(ref transport);

            SimpleListContainer<PromoCodeRecord, IDictionary> actual = new SimpleListContainer<PromoCodeRecord, IDictionary>(container);
            Assert.Fail("Exception not thrown");
        }
        #endregion

        #region Add
        /// <summary>
        /// Positive: Proper value
        /// </summary>
        [TestMethod]
        public void AddTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();

            target.Add(item);
            Assert.AreEqual<int>(1, target.Count);
            Assert.AreEqual<PromoCodeRecord>(item, target[0]);
        }

        /// <summary>
        /// Positive: Null value
        /// </summary>
        [TestMethod]
        public void AddTest2()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = null;

            target.Add(item);
            Assert.AreEqual<int>(1, target.Count);
            Assert.AreEqual<PromoCodeRecord>(item, target[0]);
        }

        /// <summary>
        /// Positive: Proper value multiple times
        /// </summary>
        [TestMethod]
        public void AddTest3()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = null;

            target.Add(item);
            target.Add(item);
            Assert.AreEqual<int>(2, target.Count);
            Assert.AreEqual<PromoCodeRecord>(item, target[0]);
            Assert.AreEqual<PromoCodeRecord>(item, target[1]);
        }

        /// <summary>
        /// Positive: Proper value as object
        /// </summary>
        [TestMethod]
        public void AddTest4()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            object item = new PromoCodeRecord();

            target.Add(item);
            Assert.AreEqual<int>(1, target.Count);
            Assert.AreEqual<PromoCodeRecord>((PromoCodeRecord)item, target[0]);
        }

        /// <summary>
        /// Fault: Incorrect type
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentTypeException))]
        public void AddFaultTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            object item = int.MaxValue;

            target.Add(item);
            Assert.Fail("Exception not thrown.");
        }
        #endregion

        #region AddRange
        /// <summary>
        /// Positive: Proper value
        /// </summary>
        [TestMethod]
        public void AddRangeTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            List<PromoCodeRecord> collection = new List<PromoCodeRecord>();
            PromoCodeRecord item = new PromoCodeRecord();
            collection.Add(item);

            target.AddRange(collection);

            Assert.AreEqual<int>(1, target.Count);
            Assert.AreEqual<PromoCodeRecord>(collection[0], target[0]);
        }

        /// <summary>
        /// Positive: Empty collection
        /// </summary>
        [TestMethod]
        public void AddRangeTest2()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            List<PromoCodeRecord> collection = new List<PromoCodeRecord>();

            target.AddRange(collection);

            Assert.AreEqual<int>(0, target.Count);
        }

        /// <summary>
        /// Positive: Ensure elements were added to the end of the list and order is preserved.
        /// </summary>
        [TestMethod]
        public void AddRangeTest3()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 0;
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 1;
            target.Add(item);

            List<PromoCodeRecord> collection = new List<PromoCodeRecord>();
            item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 3;
            collection.Add(item);
            item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 4;
            collection.Add(item);
            item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 5;
            collection.Add(item);

            target.AddRange(collection);

            Assert.AreEqual<int>(5, target.Count);
            for (int index = 1; index < 5; index++)
            {
                Assert.IsTrue(target[index - 1].PromoCodeDefinitionId < target[index].PromoCodeDefinitionId);
            }
        }

        /// <summary>
        /// Positive: Null collection member if reference type
        /// </summary>
        [TestMethod]
        public void AddRangeTest4()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            List<PromoCodeRecord> collection = new List<PromoCodeRecord>();
            collection.Add(null);

            target.AddRange(collection);

            Assert.AreEqual<int>(1, target.Count);
            Assert.AreEqual<PromoCodeRecord>(collection[0], target[0]);
        }

        /// <summary>
        /// Fault: Null parameter
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentNullException))]
        public void AddRangeFaultTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            List<PromoCodeRecord> collection = null;

            target.AddRange(collection);
            Assert.Fail("Exception not thrown.");
        }
        #endregion

        #region AsReadOnly
        /// <summary>
        /// Positive: Proper value
        /// </summary>
        [TestMethod]
        public void AsReadOnlyTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            ReadOnlyCollection<PromoCodeRecord> actual = target.AsReadOnly();
            Assert.AreEqual<int>(1, actual.Count);
            Assert.AreEqual<PromoCodeRecord>(item, actual[0]);
        }

        /// <summary>
        /// Positive: Empty collection
        /// </summary>
        [TestMethod]
        public void AsReadOnlyTest2()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            ReadOnlyCollection<PromoCodeRecord> actual = target.AsReadOnly();
            Assert.AreEqual<int>(0, actual.Count);
        }
        #endregion

        // TODO BinarySearch not implemented

        #region Contains
        /// <summary>
        /// Positive: Proper value
        /// </summary>
        [TestMethod]
        public void ContainsTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);
            Assert.AreEqual<int>(1, target.Count);

            bool actual = target.Contains(item);
            Assert.IsTrue(actual);
        }

        /// <summary>
        /// Positive: Null value
        /// </summary>
        [TestMethod]
        public void ContainsTest2()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = null;
            target.Add(item);
            Assert.AreEqual<int>(1, target.Count);

            bool actual = target.Contains(item);
            Assert.IsTrue(actual);
        }

        /// <summary>
        /// Positive: Null value buried
        /// </summary>
        [TestMethod]
        public void ContainsTest3()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);
            item = null;
            target.Add(item);

            Assert.AreEqual<int>(2, target.Count);

            bool actual = target.Contains(item);
            Assert.IsTrue(actual);
        }

        /// <summary>
        /// Positive: Null value buried
        /// </summary>
        [TestMethod]
        public void ContainsTest4()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);
            object nullvalue = null;
            target.Add(nullvalue);

            Assert.AreEqual<int>(2, target.Count);

            bool actual = target.Contains(nullvalue);
            Assert.IsTrue(actual);
        }

        /// <summary>
        /// Negative: No match
        /// </summary>
        [TestMethod]
        public void ContainsNegativeTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "bob";
            target.Add(item);
            Assert.AreEqual<int>(1, target.Count);

            item = new PromoCodeRecord();

            bool actual = target.Contains(item);
            Assert.IsFalse(actual);
        }

        /// <summary>
        /// Negative: Incompatible type
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentTypeException))]
        public void ContainsFaultTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            int intItem = 1;

            bool actual = target.Contains((object)intItem);
            Assert.Fail("Exception not thrown.");
        }
        #endregion

        #region ConvertAll
        /// <summary>
        /// Positive: Proper value
        /// </summary>
        [TestMethod]
        public void ConvertAllTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            List<string> actual = target.ConvertAll<string>(delegate(PromoCodeRecord value)
                                                        {
                                                            return (value != null ? value.PromoCode : null);
                                                        });

            Assert.AreEqual<int>(1, actual.Count);
            Assert.AreEqual<string>(item.PromoCode, actual[0]);
        }

        /// <summary>
        /// Fault: Null value
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentNullException))]
        public void ConvertAllFaultTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            List<long> actual = target.ConvertAll<long>(null);
            Assert.Fail("Exception not thrown.");
        }
        #endregion

        #region CopyTo
        /// <summary>
        /// Positive: Proper value
        /// </summary>
        [TestMethod]
        public void CopyToTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            PromoCodeRecord[] actual = new PromoCodeRecord[target.Count];

            target.CopyTo(actual);
            Assert.AreEqual<int>(1, actual.Length);
            Assert.AreEqual<PromoCodeRecord>(item, actual[0]);
        }

        /// <summary>
        /// Positive: Ensure elements were added to the end of the list and order is preserved.
        /// </summary>
        [TestMethod]
        public void CopyToTest2()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 0;
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 1;
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 2;
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 3;
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 4;
            target.Add(item);

            PromoCodeRecord[] actual = new PromoCodeRecord[target.Count];

            target.CopyTo(actual);
            Assert.AreEqual<int>(5, actual.Length);
            for (int index = 1; index < 5; index++)
            {
                Assert.IsTrue(actual[index - 1].PromoCodeDefinitionId < actual[index].PromoCodeDefinitionId);
            }
        }

        /// <summary>
        /// Positive: Ensure elements were added to the end of the list and order is preserved.
        /// </summary>
        [TestMethod]
        public void CopyToTest3()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 0;
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 1;
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 2;
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 3;
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 4;
            target.Add(item);

            PromoCodeRecord[] actual = new PromoCodeRecord[target.Count + 2];

            int arrayIndex = 1;
            target.CopyTo(actual, arrayIndex);
            Assert.AreEqual<int>(7, actual.Length);
            for (int index = 2; index < 6; index++)
            {
                Assert.IsTrue(actual[index - 1].PromoCodeDefinitionId < actual[index].PromoCodeDefinitionId);
            }
        }

        /// <summary>
        /// Positive: Ensure elements were added to the end of the list and order is preserved.
        /// </summary>
        [TestMethod]
        public void CopyToTest4()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 0;
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 1;
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 2;
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 3;
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 4;
            target.Add(item);

            PromoCodeRecord[] actual = new PromoCodeRecord[target.Count + 2];
            int arrayIndex = 1;
            int count = 2;
            int index = 2;

            target.CopyTo(index, actual, arrayIndex, count);
            Assert.AreEqual<int>(7, actual.Length);
            Assert.IsTrue(actual[1].PromoCodeDefinitionId < actual[2].PromoCodeDefinitionId);
        }

        /// <summary>
        /// Positive: Proper value
        /// </summary>
        [TestMethod]
        public void CopyToTest5()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            Array array = Array.CreateInstance(typeof(PromoCodeRecord), 1);
            int index = 0;

            target.CopyTo(array, index);
            Assert.AreEqual<int>(1, array.Length);
            Assert.AreEqual<PromoCodeRecord>(item, array.GetValue(0) as PromoCodeRecord);
        }

        /// <summary>
        /// Fault: Destination array too small
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentException))]
        public void CopyToFaultTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);
            item = new PromoCodeRecord();
            target.Add(item);
            item = new PromoCodeRecord();
            target.Add(item);

            PromoCodeRecord[] actual = new PromoCodeRecord[target.Count - 2];

            target.CopyTo(actual);
            Assert.Fail("Exception not thrown.");
        }

        /// <summary>
        /// Fault: Destination array is null
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentNullException))]
        public void CopyToFaultTest2()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);
            item = new PromoCodeRecord();
            target.Add(item);
            item = new PromoCodeRecord();
            target.Add(item);

            PromoCodeRecord[] actual = null;

            target.CopyTo(actual);
            Assert.Fail("Exception not thrown.");
        }

        /// <summary>
        /// Fault: Destination array is multi-dimensional
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void CopyToFaultTest3()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            Array array = Array.CreateInstance(typeof(PromoCodeRecord), 1, 1);
            int index = 0;

            target.CopyTo(array, index);
            Assert.Fail("Exception not thrown.");
        }

        /// <summary>
        /// Fault: Null parameters
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentNullException))]
        public void CopyToFaultTest4()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord[] array = null;

            target.CopyTo(array);
            Assert.Fail("Exception not thrown.");
        }

        /// <summary>
        /// Fault: Out of range parameters
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void CopyToFaultTest5()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord[] array = new PromoCodeRecord[1];
            int index = -1;

            target.CopyTo(array, index);
            Assert.Fail("Exception not thrown.");
        }

        /// <summary>
        /// Fault: Out of range parameters
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void CopyToFaultTest6()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord[] array = new PromoCodeRecord[1];
            int index = 0;
            int arrayIndex = -1;
            int count = 0;

            target.CopyTo(index, array, arrayIndex, count);
            Assert.Fail("Exception not thrown.");
        }

        /// <summary>
        /// Fault: Out of range parameters
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void CopyToFaultTest7()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord[] array = new PromoCodeRecord[1];
            int index = 0;
            int arrayIndex = 0;
            int count = -1;

            target.CopyTo(index, array, arrayIndex, count);
            Assert.Fail("Exception not thrown.");
        }

        /// <summary>
        /// Fault: Out of range parameters
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void CopyToFaultTest8()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            PromoCodeRecord[] array = new PromoCodeRecord[1];
            int index = 0;
            int arrayIndex = 0;
            int count = int.MaxValue;

            target.CopyTo(index, array, arrayIndex, count);
            Assert.Fail("Exception not thrown.");
        }

        /// <summary>
        /// Fault: Out of range parameters
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentException))]
        public void CopyToFaultTest9()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            PromoCodeRecord[] array = new PromoCodeRecord[1];
            int index = 0;
            int arrayIndex = int.MaxValue;
            int count = 1;

            target.CopyTo(index, array, arrayIndex, count);
            Assert.Fail("Exception not thrown.");
        }

        /// <summary>
        /// Fault: Out of range parameters
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void CopyToFaultTest10()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            PromoCodeRecord[] array = new PromoCodeRecord[1];
            int index = int.MaxValue;
            int arrayIndex = 0;
            int count = 1;

            target.CopyTo(index, array, arrayIndex, count);
            Assert.Fail("Exception not thrown.");
        }

        /// <summary>
        /// Fault: Out of range parameters
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentException))]
        public void CopyToFaultTest11()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);
            item = new PromoCodeRecord();
            target.Add(item);
            item = new PromoCodeRecord();
            target.Add(item);
            item = new PromoCodeRecord();
            target.Add(item);

            PromoCodeRecord[] array = new PromoCodeRecord[2];
            int index = 0;
            int arrayIndex = 1;
            int count = 4;

            target.CopyTo(index, array, arrayIndex, count);
            Assert.Fail("Exception not thrown.");
        }

        /// <summary>
        /// Fault: Type mismatch parameters
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentTypeException))]
        public void CopyToFaultTest12()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            Array array = Array.CreateInstance(typeof(int), 1);
            int index = 0;

            target.CopyTo(array, index);
            Assert.Fail("Exception not thrown.");
        }
        #endregion

        #region Equals
        /// <summary>
        /// Positive: Same reference
        /// </summary>
        [TestMethod]
        public void EqualsTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();
            SimpleListContainer<PromoCodeRecord, IDictionary> source = target;

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            bool actual = target.Equals(source);
            Assert.IsTrue(actual);
        }

        /// <summary>
        /// Negative: Different references
        /// </summary>
        [TestMethod]
        public void EqualsNegativeTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();
            SimpleListContainer<PromoCodeRecord, IDictionary> source = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);
            source.Add(item);

            bool actual = target.Equals(source);
            Assert.IsFalse(actual);
        }
        #endregion

        #region Exists
        /// <summary>
        /// Positive: Proper value
        /// </summary>
        [TestMethod]
        public void ExistsTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            bool actual = target.Exists(delegate(PromoCodeRecord value)
                                        {
                                            return (item.Equals(value));
                                        });
            Assert.IsTrue(actual);
        }

        /// <summary>
        /// Negative: No match
        /// </summary>
        [TestMethod]
        public void ExistsNegativeTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            bool actual = target.Exists(delegate(PromoCodeRecord value)
                                        {
                                            return (value.PromoCode.Length > 50);
                                        });
            Assert.IsFalse(actual);
        }

        /// <summary>
        /// Fault: Null parameter
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentNullException))]
        public void ExistsFaultTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            Predicate<PromoCodeRecord> match = null;

            bool actual = target.Exists(match);
            Assert.Fail("Exception not thrown.");
        }
        #endregion

        #region Find
        /// <summary>
        /// Positive: Proper value
        /// </summary>
        [TestMethod]
        public void FindTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            PromoCodeRecord actual = target.Find(delegate(PromoCodeRecord value)
                                        {
                                            return (item.Equals(value));
                                        });
            Assert.IsNotNull(actual);
        }

        /// <summary>
        /// Negative: No match
        /// </summary>
        [TestMethod]
        public void FindNegativeTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            PromoCodeRecord actual = target.Find(delegate(PromoCodeRecord value)
                                        {
                                            return (value.PromoCode.Length > 50);
                                        });
            Assert.IsNull(actual);
        }

        /// <summary>
        /// Fault: Null parameter
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentNullException))]
        public void FindFaultTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            Predicate<PromoCodeRecord> match = null;

            PromoCodeRecord actual = target.Find(match);
            Assert.Fail("Exception not thrown.");
        }
        #endregion

        #region FindAll
        /// <summary>
        /// Positive: Proper value
        /// </summary>
        [TestMethod]
        public void FindAllTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCode = "Lorem not ipsum";
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCode = "AdLorem not ipsum";
            target.Add(item);

            List<PromoCodeRecord> actual = target.FindAll(delegate(PromoCodeRecord value)
                                        {
                                            return value.PromoCode.StartsWith("Lorem");
                                        });
            Assert.IsNotNull(actual);
            Assert.AreEqual<int>(3, actual.Count);
            Assert.AreEqual<PromoCodeRecord>(target[0], actual[0]);
            Assert.AreEqual<PromoCodeRecord>(target[1], actual[1]);
            Assert.AreEqual<PromoCodeRecord>(target[2], actual[2]);
        }

        /// <summary>
        /// Negative: No match
        /// </summary>
        [TestMethod]
        public void FindAllNegativeTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            List<PromoCodeRecord> actual = target.FindAll(delegate(PromoCodeRecord value)
                                        {
                                            return (value.PromoCode.Length > 50);
                                        });
            Assert.IsNotNull(actual);
            Assert.AreEqual<int>(0, actual.Count);
        }

        /// <summary>
        /// Fault: Null parameter
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentNullException))]
        public void FindAllFaultTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);

            Predicate<PromoCodeRecord> match = null;

            List<PromoCodeRecord> actual = target.FindAll(match);
            Assert.Fail("Exception not thrown.");
        }
        #endregion

        #region FindIndex
        /// <summary>
        /// Positive: Proper value
        /// </summary>
        [TestMethod]
        public void FindIndexTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            int actual = target.FindIndex(delegate(PromoCodeRecord value)
                                        {
                                            return (item.Equals(value));
                                        });
            Assert.AreEqual<int>(0, actual);
        }

        /// <summary>
        /// Positive: Proper value
        /// </summary>
        [TestMethod]
        public void FindIndexTest2()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCode = "Lorem not ipsum";
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCode = "AdLorem not ipsum";
            target.Add(item);

            int startIndex = 2;
            int actual = target.FindIndex(startIndex, delegate(PromoCodeRecord value)
                                        {
                                            return value.PromoCode.StartsWith("Lorem");
                                        });
            Assert.AreEqual<int>(2, actual);
        }

        /// <summary>
        /// Negative: No match
        /// </summary>
        [TestMethod]
        public void FindIndexNegativeTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            int actual = target.FindIndex(delegate(PromoCodeRecord value)
                                        {
                                            return (value.PromoCode.Length > 50);
                                        });
            Assert.AreEqual<int>(-1, actual);
        }

        /// <summary>
        /// Negative: No match
        /// </summary>
        [TestMethod]
        public void FindIndexNegativeTest2()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCode = "Lorem not ipsum";
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCode = "AdLorem not ipsum";
            target.Add(item);

            int startIndex = 3;
            int actual = target.FindIndex(startIndex, delegate(PromoCodeRecord value)
                                        {
                                            return value.PromoCode.StartsWith("Lorem");
                                        });
            Assert.AreEqual<int>(-1, actual);
        }

        /// <summary>
        /// Fault: Null parameter
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentNullException))]
        public void FindIndexFaultTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);

            Predicate<PromoCodeRecord> match = null;

            int actual = target.FindIndex(match);
            Assert.Fail("Exception not thrown.");
        }

        /// <summary>
        /// Fault: Out of Range parameter
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void FindIndexFaultTest2()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);

            Predicate<PromoCodeRecord> match = delegate(PromoCodeRecord value) { return value.PromoCode.StartsWith("Lorem"); };
            int startIndex = int.MaxValue;
            int count = 0;

            int actual = target.FindIndex(startIndex, count, match);
            Assert.Fail("Exception not thrown.");
        }

        /// <summary>
        /// Fault: Out of Range parameter
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void FindIndexFaultTest3()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);

            Predicate<PromoCodeRecord> match = delegate(PromoCodeRecord value) { return value.PromoCode.StartsWith("Lorem"); };
            int startIndex = 0;
            int count = int.MinValue;

            int actual = target.FindIndex(startIndex, count, match);
            Assert.Fail("Exception not thrown.");
        }
        #endregion

        #region FindLast
        /// <summary>
        /// Positive: Proper value
        /// </summary>
        [TestMethod]
        public void FindLastTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);
            PromoCodeRecord item2 = new PromoCodeRecord();
            item2.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item2);
            item = new PromoCodeRecord();
            target.Add(item);

            PromoCodeRecord actual = target.FindLast(delegate(PromoCodeRecord value)
                                        {
                                            return (value.PromoCode.Equals(item2.PromoCode));
                                        });
            Assert.IsNotNull(actual);
        }

        /// <summary>
        /// Negative: No match
        /// </summary>
        [TestMethod]
        public void FindLastNegativeTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            PromoCodeRecord actual = target.FindLast(delegate(PromoCodeRecord value)
                                        {
                                            return (value.PromoCode.Length > 50);
                                        });
            Assert.IsNull(actual);
        }

        /// <summary>
        /// Fault: Null parameter
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentNullException))]
        public void FindLastFaultTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            Predicate<PromoCodeRecord> match = null;

            PromoCodeRecord actual = target.FindLast(match);
            Assert.Fail("Exception not thrown.");
        }
        #endregion

        #region FindLastIndex
        /// <summary>
        /// Positive: Proper value
        /// </summary>
        [TestMethod]
        public void FindLastIndexTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            int actual = target.FindLastIndex(delegate(PromoCodeRecord value)
                                        {
                                            return (item.Equals(value));
                                        });
            Assert.AreEqual<int>(0, actual);
        }

        /// <summary>
        /// Positive: Proper value
        /// </summary>
        [TestMethod]
        public void FindLastIndexTest2()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCode = "Lorem not ipsum";
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCode = "AdLorem not ipsum";
            target.Add(item);

            int startIndex = target.Count - 1;
            int actual = target.FindLastIndex(startIndex, delegate(PromoCodeRecord value)
                                        {
                                            return value.PromoCode.StartsWith("Lorem");
                                        });
            Assert.AreEqual<int>(2, actual);
        }

        /// <summary>
        /// Negative: No match
        /// </summary>
        [TestMethod]
        public void FindLastIndexNegativeTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            int actual = target.FindLastIndex(delegate(PromoCodeRecord value)
                                        {
                                            return (value.PromoCode.Length > 50);
                                        });
            Assert.AreEqual<int>(-1, actual);
        }

        /// <summary>
        /// Negative: No match
        /// </summary>
        [TestMethod]
        public void FindLastIndexNegativeTest2()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCode = "Lorem not ipsum";
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCode = "AdLorem not ipsum";
            target.Add(item);

            int startIndex = 2;
            int actual = target.FindLastIndex(startIndex, delegate(PromoCodeRecord value)
                                        {
                                            return value.PromoCode.StartsWith("AdLorem");
                                        });
            Assert.AreEqual<int>(-1, actual);
        }

        /// <summary>
        /// Fault: Null parameter
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentNullException))]
        public void FindLastIndexFaultTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            Predicate<PromoCodeRecord> match = null;

            int actual = target.FindLastIndex(match);
            Assert.Fail("Exception not thrown.");
        }

        /// <summary>
        /// Fault: Out of Range parameter
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void FindLastIndexFaultTest2()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            Predicate<PromoCodeRecord> match = delegate(PromoCodeRecord value) { return value.PromoCode.StartsWith("Lorem"); };
            int startIndex = int.MaxValue;
            int count = 0;

            int actual = target.FindLastIndex(startIndex, count, match);
            Assert.Fail("Exception not thrown.");
        }

        /// <summary>
        /// Fault: Out of Range parameter
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void FindLastIndexFaultTest3()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            Predicate<PromoCodeRecord> match = delegate(PromoCodeRecord value) { return value.PromoCode.StartsWith("Lorem"); };
            int startIndex = 0;
            int count = int.MinValue;

            int actual = target.FindLastIndex(startIndex, count, match);
            Assert.Fail("Exception not thrown.");
        }
        #endregion

        #region ForEach
        /// <summary>
        /// Positive: Appends value
        /// </summary>
        [TestMethod]
        public void ForEachTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            int counter = 0;

            target.ForEach(delegate(PromoCodeRecord value)
                            {
                                if (item.Equals(value))
                                {
                                    counter++;
                                }
                            });

            Assert.AreEqual<int>(target.Count, counter);
        }

        /// <summary>
        /// Fault: Null parameter
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentNullException))]
        public void ForEachFaultTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            Action<PromoCodeRecord> action = null;

            target.ForEach(action);
            Assert.Fail("Exception was not thrown.");
        }
        #endregion

        #region GetEnumerator
        /// <summary>
        /// Positive: Proper value
        /// </summary>
        [TestMethod]
        public void GetEnumeratorTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCode = "Lorem not ipsum";
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCode = "AdLorem not ipsum";
            target.Add(item);

            IEnumerator<PromoCodeRecord> actual = target.GetEnumerator();
            Assert.IsNotNull(actual);

            int counter = 0;
            while (actual.MoveNext())
            {
                Assert.AreEqual<string>(target[counter].PromoCode, actual.Current.PromoCode);
                counter++;
            }

            Assert.IsTrue(counter > 0);
        }
        #endregion

        #region GetRange
        /// <summary>
        /// Positive: get the range
        /// </summary>
        [TestMethod]
        public void GetRangeTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCode = "Lorem not ipsum";
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCode = "AdLorem not ipsum";
            target.Add(item);

            int index = 1;
            int count = 2;

            List<PromoCodeRecord> actual = target.GetRange(index, count);
            Assert.AreEqual<int>(count, actual.Count);
            for (int index2 = 0; index2 < 2; index2++)
            {
                Assert.AreEqual<PromoCodeRecord>(target[index2 + 1], actual[index2]);
            }
        }

        /// <summary>
        /// Fault: Neutral parameters
        /// </summary>
        [TestMethod]
        public void GetRangeTest2()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            int index = 0;
            int count = 0;

            List<PromoCodeRecord> actual = target.GetRange(index, count);
            Assert.AreEqual<int>(count, actual.Count);
        }

        /// <summary>
        /// Fault: parameters out of range
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void GetRangeFaultTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);

            int index = 2;
            int count = 1;

            List<PromoCodeRecord> actual = target.GetRange(index, count);
            Assert.Fail("Exception not thrown.");
        }

        /// <summary>
        /// Fault: parameters out of range
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void GetRangeFaultTest2()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);

            int index = -1;
            int count = 1;

            List<PromoCodeRecord> actual = target.GetRange(index, count);
            Assert.Fail("Exception not thrown.");
        }

        /// <summary>
        /// Fault: parameters out of range
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void GetRangeFaultTest3()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);

            int index = 0;
            int count = -1;

            List<PromoCodeRecord> actual = target.GetRange(index, count);
            Assert.Fail("Exception not thrown.");
        }
        #endregion

        #region IndexOf
        /// <summary>
        /// Positive: Proper value
        /// </summary>
        [TestMethod]
        public void IndexOfTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);

            int actual = target.IndexOf(item);
            Assert.AreEqual<int>(0, actual);
        }

        /// <summary>
        /// Positive: Proper value
        /// </summary>
        [TestMethod]
        public void IndexOfTest2()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);
            target.Add(item);
            PromoCodeRecord item2 = new PromoCodeRecord();
            item2.PromoCode = "Lorem not ipsum";
            target.Add(item2);
            PromoCodeRecord item3 = new PromoCodeRecord();
            item3.PromoCode = "AdLorem not ipsum";
            target.Add(item3);

            int index = 2;
            int count = 2;
            int actual = target.IndexOf(item2, index, count);
            Assert.AreEqual<int>(2, actual);
        }

        /// <summary>
        /// Positive: Null value
        /// </summary>
        [TestMethod]
        public void IndexOfTest3()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);
            target.Add(item);
            PromoCodeRecord item2 = new PromoCodeRecord();
            item2.PromoCode = "Lorem not ipsum";
            target.Add(item2);
            target.Add(null);
            PromoCodeRecord item3 = new PromoCodeRecord();
            item3.PromoCode = "AdLorem not ipsum";
            target.Add(item3);

            int index = 2;
            int count = 3;
            int actual = target.IndexOf(null, index, count);
            Assert.AreEqual<int>(3, actual);
        }

        /// <summary>
        /// Positive: Loop past null value
        /// </summary>
        [TestMethod]
        public void IndexOfTest4()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);
            target.Add(item);
            PromoCodeRecord item2 = new PromoCodeRecord();
            item2.PromoCode = "Lorem not ipsum";
            target.Add(item2);
            target.Add(null);
            PromoCodeRecord item3 = new PromoCodeRecord();
            item3.PromoCode = "AdLorem not ipsum";
            target.Add(item3);

            int index = 0;
            int actual = target.IndexOf(item3, index);
            Assert.AreEqual<int>(4, actual);
        }

        /// <summary>
        /// Positive: Proper value
        /// </summary>
        [TestMethod]
        public void IndexOfTest5()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);

            int actual = target.IndexOf((object)item);
            Assert.AreEqual<int>(0, actual);
        }

        /// <summary>
        /// Negative: No match
        /// </summary>
        [TestMethod]
        public void IndexOfNegativeTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);

            PromoCodeRecord item2 = new PromoCodeRecord();

            int actual = target.IndexOf(item2);
            Assert.AreEqual<int>(-1, actual);
        }

        /// <summary>
        /// Negative: No match
        /// </summary>
        [TestMethod]
        public void IndexOfNegativeTest2()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);
            target.Add(item);
            PromoCodeRecord item2 = new PromoCodeRecord();
            item2.PromoCode = "Lorem not ipsum";
            target.Add(item2);
            PromoCodeRecord item3 = new PromoCodeRecord();
            item3.PromoCode = "AdLorem not ipsum";
            target.Add(item3);

            int index = 2;
            int count = 2;
            int actual = target.IndexOf(item, index, count);
            Assert.AreEqual<int>(-1, actual);
        }

        /// <summary>
        /// Fault: Out of Range parameter
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void IndexOfFaultTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);

            int index = int.MaxValue;
            int count = 0;

            int actual = target.IndexOf(item, index, count);
            Assert.Fail("Exception not thrown.");
        }

        /// <summary>
        /// Fault: Out of Range parameter
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void IndexOfFaultTest3()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);

            int index = 0;
            int count = int.MaxValue;

            int actual = target.IndexOf(item, index, count);
            Assert.Fail("Exception not thrown.");
        }

        /// <summary>
        /// Fault: Out of Range parameter
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void IndexOfFaultTest4()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);
            target.Add(item);
            target.Add(item);
            target.Add(item);

            int index = 2;
            int count = 5;

            int actual = target.IndexOf(item, index, count);
            Assert.Fail("Exception not thrown.");
        }

        /// <summary>
        /// Fault: Out of Range parameter
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void IndexOfFaultTest5()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);
            target.Add(item);
            target.Add(item);
            target.Add(item);

            int index = int.MaxValue;

            int actual = target.IndexOf(item, index);
            Assert.Fail("Exception not thrown.");
        }

        /// <summary>
        /// Fault: Incompatible type
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentTypeException))]
        public void IndexOfFaultTest6()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);
            target.Add(item);
            target.Add(item);
            target.Add(item);

            int intItem = 2;

            int actual = target.IndexOf((object)intItem);
            Assert.Fail("Exception not thrown.");
        }
        #endregion

        #region Insert
        /// <summary>
        /// Positive: Proper value
        /// </summary>
        [TestMethod]
        public void InsertTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";

            int index = 0;

            target.Insert(index, item);
            Assert.AreEqual<int>(1, target.Count);
            Assert.AreEqual<PromoCodeRecord>(item, target[0]);
        }

        /// <summary>
        /// Positive: Null value
        /// </summary>
        [TestMethod]
        public void InsertTest2()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = null;

            int index = 0;

            target.Insert(index, item);
            Assert.AreEqual<int>(1, target.Count);
            Assert.AreEqual<PromoCodeRecord>(item, target[0]);
        }

        /// <summary>
        /// Positive: Proper value multiple times
        /// </summary>
        [TestMethod]
        public void InsertTest3()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";

            int index = 0;

            target.Insert(index, item);
            target.Insert(index, item);
            Assert.AreEqual<int>(2, target.Count);
            Assert.AreEqual<PromoCodeRecord>(item, target[0]);
            Assert.AreEqual<PromoCodeRecord>(item, target[1]);
        }

        /// <summary>
        /// Positive: Proper value as object
        /// </summary>
        [TestMethod]
        public void InsertTest4()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            object item = new PromoCodeRecord();

            int index = 0;

            target.Insert(index, item);
            Assert.AreEqual<int>(1, target.Count);
            Assert.AreEqual<PromoCodeRecord>((PromoCodeRecord)item, target[0]);
        }

        /// <summary>
        /// Positive: Proper value multiple times, inspect middle
        /// </summary>
        [TestMethod]
        public void InsertTest5()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";

            int index = 0;
            target.Insert(index, item);

            index = 1;
            item = new PromoCodeRecord();
            item.PromoCode = "Vivamus sit amet nisi iaculis nisi lacinia accumsan.";
            target.Insert(index, item);
            target.Insert(index, item);
            target.Insert(index, item);

            index = 1;
            item = new PromoCodeRecord();
            item.PromoCode = "Duis leo tellus, tempus et, dapibus nec, eleifend vitae, nisl. In nec mauris.";
            target.Insert(index, item);

            Assert.AreEqual<int>(5, target.Count);
            Assert.AreEqual<PromoCodeRecord>(item, target[1]);
        }


        /// <summary>
        /// Fault: Incorrect type
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentTypeException))]
        public void InsertFaultTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            int index = 0;
            int item = int.MaxValue;

            target.Insert(index, item);
            Assert.Fail("Exception not thrown.");
        }

        /// <summary>
        /// Positive: Out of range
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void InsertFaultTest2()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            int index = int.MaxValue - 5;
            PromoCodeRecord item = new PromoCodeRecord();

            target.Insert(index, item);
            Assert.Fail("Exception not thrown.");
        }
        #endregion

        #region InsertRange
        /// <summary>
        /// Positive: Proper value
        /// </summary>
        [TestMethod]
        public void InsertRangeTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            int index = 0;
            List<PromoCodeRecord> collection = new List<PromoCodeRecord>();
            PromoCodeRecord item = new PromoCodeRecord();
            collection.Insert(0, item);

            target.InsertRange(index, collection);

            Assert.AreEqual<int>(1, target.Count);
            Assert.AreEqual<PromoCodeRecord>(collection[0], target[0]);
        }

        /// <summary>
        /// Positive: Empty collection
        /// </summary>
        [TestMethod]
        public void InsertRangeTest2()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            int index = 0;
            List<PromoCodeRecord> collection = new List<PromoCodeRecord>();

            target.InsertRange(index, collection);

            Assert.AreEqual<int>(0, target.Count);
        }

        /// <summary>
        /// Positive: Ensure elements were added to the end of the list and order is preserved.
        /// </summary>
        [TestMethod]
        public void InsertRangeTest3()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 0;
            target.Insert(0, item);
            item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 1;
            target.Insert(1, item);

            List<PromoCodeRecord> collection = new List<PromoCodeRecord>();
            item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 3;
            collection.Insert(0, item);
            item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 4;
            collection.Insert(1, item);
            item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 5;
            collection.Insert(2, item);

            int index = 2;

            target.InsertRange(index, collection);
            Assert.AreEqual<int>(5, target.Count);
            for (int index2 = 1; index2 < 5; index2++)
            {
                Assert.IsTrue(target[index2 - 1].PromoCodeDefinitionId < target[index2].PromoCodeDefinitionId);
            }
        }

        /// <summary>
        /// Positive: Null collection member if reference type
        /// </summary>
        [TestMethod]
        public void InsertRangeTest4()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            int index = 0;
            List<PromoCodeRecord> collection = new List<PromoCodeRecord>();
            collection.Insert(0, null);

            target.InsertRange(index, collection);

            Assert.AreEqual<int>(1, target.Count);
            Assert.AreEqual<PromoCodeRecord>(collection[0], target[0]);
        }

        /// <summary>
        /// Fault: Null parameter
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentNullException))]
        public void InsertRangeFaultTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            int index = 0;
            List<PromoCodeRecord> collection = null;

            target.InsertRange(index, collection);
            Assert.Fail("Exception not thrown.");
        }

        /// <summary>
        /// Fault: Out of range parameter
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void InsertRangeFaultTest2()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 0;
            target.Insert(0, item);
            item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 1;
            target.Insert(1, item);

            List<PromoCodeRecord> collection = new List<PromoCodeRecord>();
            item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 3;
            collection.Insert(0, item);
            item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 4;
            collection.Insert(1, item);
            item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 5;
            collection.Insert(2, item);

            int index = 500;

            target.InsertRange(index, collection);
            Assert.Fail("Exception not thrown.");
        }
        #endregion

        #region LastIndexOf
        /// <summary>
        /// Positive: Proper value
        /// </summary>
        [TestMethod]
        public void LastIndexOfTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            int actual = target.LastIndexOf(item);
            Assert.AreEqual<int>(0, actual);
        }

        /// <summary>
        /// Positive: Proper value
        /// </summary>
        [TestMethod]
        public void LastIndexOfTest2()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCode = "Lorem not ipsum";
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCode = "AdLorem not ipsum";
            target.Add(item);

            int index = target.Count - 1;
            int actual = target.LastIndexOf(item, index);
            Assert.AreEqual<int>(3, actual);
        }

        /// <summary>
        /// Positive: Null value
        /// </summary>
        [TestMethod]
        public void LastIndexOfTest3()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);
            target.Add(item);
            target.Add(null);
            item = new PromoCodeRecord();
            item.PromoCode = "Lorem not ipsum";
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCode = "AdLorem not ipsum";
            target.Add(item);

            int index = target.Count - 1;
            int actual = target.LastIndexOf(null, index);
            Assert.AreEqual<int>(2, actual);
        }

        /// <summary>
        /// Negative: No match
        /// </summary>
        [TestMethod]
        public void LastIndexOfNegativeTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            target.Add(item);

            PromoCodeRecord item2 = new PromoCodeRecord();
            item2.PromoCode = DateTime.Today.ToShortDateString();

            int actual = target.LastIndexOf(item2);
            Assert.AreEqual<int>(-1, actual);
        }

        /// <summary>
        /// Negative: No match
        /// </summary>
        [TestMethod]
        public void LastIndexOfNegativeTest2()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCode = "Lorem not ipsum";
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCode = "AdLorem not ipsum";
            target.Add(item);

            int index = 2;
            int actual = target.LastIndexOf(item, index);
            Assert.AreEqual<int>(-1, actual);
        }

        /// <summary>
        /// Fault: Out of Range parameter
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void LastIndexOfFaultTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);

            int index = int.MaxValue;
            int count = 0;

            int actual = target.LastIndexOf(item, index, count);
            Assert.Fail("Exception not thrown.");
        }

        /// <summary>
        /// Fault: Out of Range parameter
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void LastIndexOfFaultTest2()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);

            int index = 0;
            int count = int.MinValue;

            int actual = target.LastIndexOf(item, index, count);
            Assert.Fail("Exception not thrown.");
        }
        #endregion

        #region Remove
        /// <summary>
        /// Positive: Proper value
        /// </summary>
        [TestMethod]
        public void RemoveTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);
            Assert.AreEqual<int>(1, target.Count);

            bool actual = target.Remove(item);
            Assert.AreEqual<int>(0, target.Count);
            Assert.IsTrue(actual);
        }

        /// <summary>
        /// Positive: Null value
        /// </summary>
        [TestMethod]
        public void RemoveTest2()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = null;
            target.Add(item);
            Assert.AreEqual<int>(1, target.Count);

            bool actual = target.Remove(item);
            Assert.AreEqual<int>(0, target.Count);
            Assert.IsTrue(actual);
        }

        /// <summary>
        /// Positive: Proper value multiple times
        /// </summary>
        [TestMethod]
        public void RemoveTest3()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);
            target.Add(item);
            Assert.AreEqual<int>(2, target.Count);

            target.Remove(item);
            Assert.AreEqual<int>(1, target.Count);
            Assert.AreEqual<PromoCodeRecord>(item, target[0]);
        }

        /// <summary>
        /// Positive: Proper value as object
        /// </summary>
        [TestMethod]
        public void RemoveTest4()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            object item = new PromoCodeRecord();
            target.Add(item);
            Assert.AreEqual<int>(1, target.Count);

            target.Remove(item);
            Assert.AreEqual<int>(0, target.Count);
        }

        /// <summary>
        /// Fault: Incorrect type
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentTypeException))]
        public void RemoveFaultTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            int item = int.MaxValue;

            target.Remove(item);
            Assert.Fail("Exception not thrown.");
        }
        #endregion

        #region RemoveRange
        /// <summary>
        /// Positive: Proper value
        /// </summary>
        [TestMethod]
        public void RemoveRangeTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);
            Assert.AreEqual<int>(1, target.Count);

            int index = 0;
            int count = 1;

            target.RemoveRange(index, count);
            Assert.AreEqual<int>(0, target.Count);
        }

        /// <summary>
        /// Positive: Empty collection
        /// </summary>
        [TestMethod]
        public void RemoveRangeTest2()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            int index = 0;
            int count = 0;

            target.RemoveRange(index, count);
            Assert.AreEqual<int>(0, target.Count);
        }

        /// <summary>
        /// Positive: Remove middle of collection
        /// </summary>
        [TestMethod]
        public void RemoveRangeTest3()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 1;
            target.Insert(0, item);
            item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 2;
            target.Insert(1, item);
            item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 3;
            target.Insert(2, item);
            item = new PromoCodeRecord();
            item.PromoCodeDefinitionId = 4;
            target.Insert(3, item);
            Assert.AreEqual<int>(4, target.Count);

            int index = 1;
            int count = 2;

            target.RemoveRange(index, count);
            Assert.AreEqual<int>(2, target.Count);
            Assert.AreEqual<int>(1, target[0].PromoCodeDefinitionId);
            Assert.AreEqual<int>(4, target[1].PromoCodeDefinitionId);
        }

        /// <summary>
        /// Positive: Null collection member if reference type
        /// </summary>
        [TestMethod]
        public void RemoveRangeTest4()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = null;
            target.Add(item);
            Assert.AreEqual<int>(1, target.Count);

            int index = 0;
            int count = 1;

            target.RemoveRange(index, count);
            Assert.AreEqual<int>(0, target.Count);
        }

        /// <summary>
        /// Fault: Out of range parameter
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void RemoveRangeFaultTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            int index = int.MaxValue;
            int count = 0;

            target.RemoveRange(index, count);
            Assert.Fail("Exception not thrown.");
        }

        /// <summary>
        /// Fault: Out of range parameter
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void RemoveRangeFaultTest2()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            int index = 0;
            int count = int.MaxValue;

            target.RemoveRange(index, count);
            Assert.Fail("Exception not thrown.");
        }

        /// <summary>
        /// Fault: Out of range parameter
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void RemoveRangeFaultTest3()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);
            Assert.AreEqual<int>(1, target.Count);

            int index = 0;
            int count = int.MaxValue;

            target.RemoveRange(index, count);
            Assert.Fail("Exception not thrown.");
        }

        /// <summary>
        /// Fault: Out of range parameter
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void RemoveRangeFaultTest4()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);
            target.Add(item);
            target.Add(item);
            Assert.AreEqual<int>(3, target.Count);

            int index = 1;
            int count = int.MaxValue;

            target.RemoveRange(index, count);
            Assert.Fail("Exception not thrown.");
        }
        #endregion

        // TODO Reverse not implemented

        // TODO Sort not implemented

        #region ToArray
        /// <summary>
        /// Positive: Values in list
        /// </summary>
        [TestMethod]
        public void ToArrayTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);
            Assert.AreEqual<int>(1, target.Count);

            PromoCodeRecord[] actual = target.ToArray();
            Assert.AreEqual<int>(1, actual.Length);
            Assert.AreEqual(item, actual[0]);
        }

        /// <summary>
        /// Positive: Empty list
        /// </summary>
        [TestMethod]
        public void ToArrayTest2()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            Assert.AreEqual<int>(0, target.Count);

            PromoCodeRecord[] actual = target.ToArray();
            Assert.AreEqual<int>(0, actual.Length);
        }
        #endregion

        #region TrueForAll
        /// <summary>
        /// Positive: Proper value
        /// </summary>
        [TestMethod]
        public void TrueForAllTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCode = "Lorem not ipsum";
            target.Add(item);

            bool actual = target.TrueForAll(delegate(PromoCodeRecord value)
                                        {
                                            return value.PromoCode.StartsWith("Lorem");
                                        });
            Assert.IsTrue(actual);
        }

        /// <summary>
        /// Negative: No match
        /// </summary>
        [TestMethod]
        public void TrueForAllNegativeTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCode = "Lorem not ipsum";
            target.Add(item);
            item = new PromoCodeRecord();
            item.PromoCode = "AdLorem not ipsum";
            target.Add(item);

            bool actual = target.TrueForAll(delegate(PromoCodeRecord value)
                                        {
                                            return value.PromoCode.StartsWith("Lorem");
                                        });
            Assert.IsFalse(actual);
        }

        /// <summary>
        /// Fault: Null parameter
        /// </summary>
        [TestMethod, ExpectedException(typeof(ArgumentNullException))]
        public void TrueForAllFaultTest1()
        {
            SimpleListContainer<PromoCodeRecord, IDictionary> target = new SimpleListContainer<PromoCodeRecord, IDictionary>();

            PromoCodeRecord item = new PromoCodeRecord();
            item.PromoCode = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam et nisi.";
            target.Add(item);

            Predicate<PromoCodeRecord> match = null;

            bool actual = target.TrueForAll(match);
            Assert.Fail("Exception not thrown.");
        }
        #endregion
    }
}
